////////////////////////////////////////////////////////
// CodePlex - metacpp
//--------------------
// This file is part of "metacpp" project on CodePlex. The
// goal if the project is to demonstrate basic techniques
// used in C++ metaprogrammins.
// For more info and comments please visit:
// http://www.codeplex.com/metacpp/
////////////////////////////////////////////////////////

#include <iostream>
#include <typeinfo.h>

///////////////////////////////////
// AUTOMATIC DEDUCTION of
// template parameters

// FUNCTIONS ONLY

template<typename T>
void print(const T& t) {
	std::cout << t << " \"" << typeid(T).name() << '\"' << std::endl;
}

/*
template<>
void print<const char*>(const char *b) {
	std::cout << b << " \"" << "char-4" << '\"' << std::endl;
}
*/

void show_automatic_type_deduction(void) {
	std::cout << "AUTOMATIC TYPE DEDUCTION:" << std::endl;
	print(10);
	char * s = "hello";
	print("hello");
	print("hell");
}